Optimized the reduceRow/ColVectors function for the number of reducers