game logic code done