finished part 5 of hw5.