Added isGoalState method