instrument the algorithm