First test-passing implementation