remove array_indices for efficiency