added gravity and applyForce function