documentation for next_tuple