implement end game