`Range` is only guaranteed to be a `ForwardRange`, and doesn't necessarily have `length`. You should just use `slen`/`tlen` below (found using `walkLength`).