added clean_up_indices