A new way of incorporating powder diffraction data into a cost function to predict the crystalline structure of inorganic solids is proposed. This approach was applied to the following series of compounds: cubic SrTiO3, tetragonal NaNbO3, TiO2 (anatase), tetragonal CaTiO3, and hexagonal BaTiO3. A tremendous increase in the efficiency of obtaining the correct structure is achieved when a cost function based upon this new approach is applied to these problems.