An engine is just a machine that converts thermal energy to mechanical energy