During the filtration process, water flows through the resin column until the resin is considered exhausted. That happens only when water leaving the column contains more than the maximal desired concentration of the ions being removed. Resin is then regenerated by sequentially backwashing the resin bed to remove accumulated suspended solids, flushing removed ions from the resin with a concentrated solution of replacement ions, and rinsing the flushing solution from the resin. Production of backwash, flushing, and rinsing wastewater during regeneration of ion-exchange media limits the usefulness of ion exchange for wastewater treatment.