moved code to determine global game status to separate function