Changing row/col check code to be first