iteration not necessary when using recursion