update algorithm in docs