Functions for updating database and deleting. Insertion now checks whether the item exists or not looking at the link.
Added comments to Database functions