Code to control the alarm system