Indexing splitted to another function, some tests for indexing