Added code to build index all at once instead of using AddRange()