Improved generator to include directories and tried the first text