Changed input variables to:
filename
filevar
dataPath
Also changed if/else statement