solved hw6, 6