this code only needs to be executed, if indices need to be created (thats why the indices are extracted from there)