Integrated danny's new index, but I receive index out of bounds for certain document IDs.. I'll leave it till tonight