Reorder game loop

Use input, update and draw order