hw9 refinements