d = [0 6 8 5 9;5 -2 -1 -1 -3;3 -1 -3 -1 -2]
d = pivot(d,4,2)
d = pivot(d,1,1)
d = pivot(d,2,2)
d = pivot(d,3,2)