implemented indexing of fields