Edited second set of algs