implemented the first version