Fixed a bug in addMultiple and finished the pivotmethod