cleanup
reorganized functions
Reordered collision checks to fix wall collision bug
Fixed whitespace formatting