More debug, and now handles more than 2 operands

Optimizes correctly for more than 2 operands with the same operator