solving problem 12 once and for all....