Added comments to explain insert and update operations