Yifan Hu algo implemented and tested.