made separate function for checking for a tie state