Added functionality to delete and edit