added game end and test mode var