added edit and delete functions with few loose ends