Added alarm function.