Implemented the remove method