encase game in function to prevent cheating