adding looping of files instead of manually entering them and more refactoring effort