algorithm detail