alarm calculation should work