refactored code to have IntPhysics class