checkVar function

checkVar: Function used to check variable names.