rewrite function next_row
add reading merged cells