implement checkLastPossibleRow and checkLastPossibleColumn