Controlling Water Quality in Water Distribution Systems