fixed bug involving accidental switch of rows and cols