prototyped function for row checking