Solenoids in combination with valves