completed advanced simplifier