implemented simplify