updates on comparision algorithm