Partial sum implementation

Done.