Completed implementation of physics calculation