added algorithms, made back work on a stack, other changes