method get_next = if len > 0 then if pos + 1 >= len then None else (pos <- pos + 1; Some t.(pos)) else None