Crafting the game loop