update add-algorithm