Make it work
Move occurence of clearIndices. Replace all indices in the end
Renaming and clean up