updated definition of $TERM