algorithm pseudo code added in ./doc