first version with all tests