Port SizeSequence to Scala