attempt at recursion