Added the correct alarm manager and implemented some application logic
too.