Finished the coding part of Homework 7