Added support for returning the actual sequence rather than just the length