much refactoring for better physics implementation in maps