alter algorithm