added functions to check game status and handle game wins and ties