part of hw6, hw8