Finished the programming part of homework 8