first implementation of the text indexer
fixed and added indexing functionality