added automated light switching