added elements from main game logic