Engines and methods of controlling an engine may include producing ammonia from exhaust gas and using the ammonia to reduce certain emission components of the exhaust. Timing of valve closing/opening and use of an air supply system may enable engine operation according to a Miller cycle.
 For some of the embodiments disclosed herein, one or more parts was made with government support under the terms of Contract No. DE-FC05-970R22605 awarded by the Department of Energy. The government may have certain rights to certain inventions disclosed herein.