added a method to the Model class to update ball position and check for collisions