checkRow and checkColumn