implemented jumping functionality, might not be perfect
cleaned the code