Add code for assignment 2, part 3.