add edge case of 1 col
correct edge cases for changing m and n