HW9 (refactor code)
HW9 (refactor code)