finished prob3 of hw6