hw 4 question 2 - modify to suit own project