added various intrinsic variables for CWD, TARGET_FILE
updated template