Partial sum implementation

All kinds of weird formatting going on in this file. What editor do you use that it messed up the indenting this badly? It would drive me crazy.