refactor 1, adding alarm