new algorithm

new algorithm