finish mcgbGenerating and generalSimplify algorithms