describing the algorithm