finish part 1 and 2 of homework 8