wrote end game check function