Proof of concept.
Little optimization.
Clean proof of concept, add unit tests.