hw10 problem3 finished