added an edit function
added a flash message when creating/deleting/updating