added NaN test for check_row_index
added doc in code for check_row_index