an engine works