Partial sum implementation

done.