Improve to work with any specified path to input files