Extended the evaluator to flatten expressions