rewriting main parts of game