Fixed loop bug, made gameLoop modular