I'm really confused, because in my book they said that in creating metal ions, electrons are subtracted from the p-orbitals, the s-orbitals and then if needed the d-orbitals from the preceding energy level. This would make sense in general, but I thought d-orbitals were usually higher-energy than the s orbital directly above them because of their configuration around the nucleus. For instance, I thought that you would go from 5s to 4d to 5p. Why, then, would the configuration of In 3+ be [Kr]4d10 instead of [Kr]5s24d8? Why wouldn't you subtract from the d-orbitals first?