described the algorithm