Part 3 of homework 3