coded entire code around alarms