Added Gravity and collision detection