physics refactored a bit