set algorithm working