broken and profied version of algs