update of algorithm