added solution to problem 6 of HW 10