cleaning code and comments, altered scope of files array