first attempt at recursion