HW1-1, first try.
Refactored hw1-1