Implemented Collect Terms transformation.