created a thread for game logic