added enum for recognizing expression type, minor improvements