Initial (incorrect) iterative attempt.
Pulled out into an initial class with tests