implemented new indexing schema and fixed unit tests