change checkcase row change algorithm