some progress in the implementation of the algo.