pass in engine to tick fucntion