Assignment 9 code after class (complete but needs review)