changed distinct processing to use a new DistinctExpression.