added preupdate and post update life cycle events
renamed a variable in preUpdate for unit