This is for part 4 of assignment 2.