first version with tests