part of hw6 solutions