Two algorithms added. Refactor.