Added better matching row numbers and fixed a next row bug