made new variable boolean solenoidFlag