Added range processing to the expression evaluation function.