Finished part1 of homework 7