Fixed jumping and various other things

Added some comments, made som default variables, and optimized a few
for-loops