First version with tests