fixed bug
Merge remote-tracking branch 'origin/Bohan-Zheng' into bowen
update algorithm