adding engine logic