Finished the coding part of the homework