use $ENVFILE to reference ENVFILE
fixed script variable names

use ...DIR rather than ...PATH throughout