switch filenames to be function parameters