completed playGame function - passed edX grader'