Fixed bugs with, and improved upon the physics engine