new logic for maingame