added get_indices function