Why do we need finalDoc if we have length?