Rearranging the code of algos.