Fixed two bugs

One bug is doing j += 1 instead of i += 1 on line 43.
The other is that I didn’t finish row reducing d_{k+1} after the
simultaneous reduce. So I added an extra row reduction routine just for
that.