removed redundant repetitive recursion