refactored physics code to allow inheritance for physical bodies