add atom_indices as a parameter.