Rewrote pivot to use underscore grouping and summing.