An initial set of phases produced by MLPHARE or any other phasing program may not necessarily result in an easily interpretable electron density map. Methods of phase refinement must usually be performed before an adequate electron density map is obtained.
The program SQUASH  incorporates three methods of phase refinement and density modification which when used simultaneously provide a powerful means of improving the electron density map. The three methods are a) phase refinement using Sayre's equation, (Eq. ), b) solvent flattening and c) histogram matching.
The program also includes options for utilising partial structure information and can perform non-crystallographic symmetry averaging but these will not be discussed.
The method of histogram matching applied to protein molecule electron density has been described by Zhang et al . A density histogram is a probability distribution of values of the electron density sampled at regular intervals (grid points) throughout the 3-dimensional map. Density histograms of protein structures have a characteristic form. The histogram matching method takes the density histogram calculated from an initial set of phases and modifies it so that it takes the form of an expected density histogram.
This is done by dividing both the measured and expected density histograms up into sections of equal area with boundaries at in the measured histogram and in the expected histogram. Scale factors and shifts are then calculated using
The density calculated from initial phases is then adjusted using
Although the the resolution of protein diffraction data does not correspond to electron density which complies with the atomicity condition required in the derivation of Sayre's equation the application of this equation is conjunction with other phase refinement and density modification techniques has been found to be of use.
The solvent flattening method  is a method of density modification whereby electron density positivity criteria are imposed and the protein crystal solvent region is assumed to be flat with a constant value of electron density. The method relies on a characteristic property of protein crystals, i.e. that they typically contain solvent which form channels through the crystal lattice.
If the initial electron density map is of a good enough quality to allow identification of the molecular boundary of individual proteins within the crystal then solvent flattening can be applied. Given a molecular boundary it is then possible to combine this information with histogram matching so that only density which lies within the molecular envelope is adjusted by Eq. .