fixed and optimized some physics stuff; working commit