Swap the functionality of the two sum fuctions

The first was actually sorting column first and thus had significantly
worse performance due to cache usage.