Implemented the edit and delete functions