added noise filter to switch checks to deal with noise on lines