Pulled in string/finite number-agnostic logic from waterline main.