last version with tests