rearranged some of the code for better readability
may of changed a couple of other things maybe minor tweaks to physics.