Hw7 solution