Added some of the functionality for edit and delete