refactored method (and names) to make the code more readable
feature added: can now process multiple source files