changed line of algorithm method