Hw5

Refactored a whole bunch