Completed the second and last part of problem 35