rearranged stuff, and added sums