added checking for predefined variables and functions