Addressed flaws identified in Megan's code review.