loops through files