fleshed out game loop