CSE 502 HW2+3 problem 3.12C