factor out gameLoop
add shebang