Added a folder hierarchy saving in the output folder, starting from the common root of files