implemented the collection reverse