wARP is a procedure that substantially improves crystallographic phases (and subsequently electron-density maps) as an additional step after density-modification methods such as solvent flattening and averaging. The initial phase set is used to create a number of dummy atom models which are subjected to least-squares or maximum-likelihood refinement and iterative model updating in an automated refinement procedure (ARP). Averaging of the phase sets calculated from the refined output models and weighting of structure factors by their similarity to an average vector results in a phase set that improves and extends the initial phases substantially. An important requirement is that the native data have a maximum resolution beyond approximately 2.4 A. The wARP procedure shortens the time-consuming step of model building in crystallographic structure determination and helps to prevent the introduction of errors.