make mainGame function in UI