Updated solenoid logic