First commit.
Worked version with tests.