physics mostly sort of working. did some cleanup and refactoring