First implementation with tests