Smartly scan to find header row