test of the algorithm