cleaned up some of the outputmat and outputvecs; confirmed phase1 and phase2 working!