updated so that now all files are in an array, then loop through them and stat on each