Collects and outputs files correctly within the data structure