first test passed
refactored magic numbers
fixed the algorithm, fixed the tests