beginning to restruction game logic