HW5 Solution