added game logic and AI