Changed functions to allow files to be defined as either array or string.