Add functions to get number of elements in sequence