Basic template algorithms added