added expression function function and modified readExpr to use it