Alarm function now working