refactor and list getPath Recursion added