fix flipped column and rows