First real code with passing tests.