initial version with recursion issue