added replies / tried recursion but doesn't work correctly