add next_position to ret_array