alarm needs to be outside of the main loop