Solved HW 6.