solution to the twelfth homework from spring 2013 1671266