reformat the index