added loop to go through the files.