added work with subfolder, changed format of output