Structure of Ionic Solids Explained