hw9 complete, closes #10