#1 fixing loop for multiple files