Added document version index

could all be `const` here