Fixed to account for cases pointed out by auto-grader