Output had rows and cols the wrong way around