anchor.diff:  %% @doc Check alarm Name for new scale request.
   on({check_alarm, Name}, {IsLeader, Alarms, ScaleReq, Triggers})
     when IsLeader andalso ScaleReq#scale_req.lock =:= unlocked  ->
  -    Alarm = get_alarm(Name, Alarms),
  +    {ok, Alarm} = get_alarm(Name, Alarms),
   
       % log current number of vms
       log_vms(),
  
positive.code: %% Alarm helpers
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  %% @doc Get alarm by name.
  -spec get_alarm(Name :: atom(), Alarms :: alarms()) -> alarm() | false.
  get_alarm(Name, Alarms) ->
      lists:keyfind(Name, 2, Alarms).
  
  %% @doc Get value for specified option key from key-value list. Return provided
  %%      default value, if key does not exist.
  
negative.code: on({toggle_alarm, Name, Pid}, {_IsLeader, Alarms, _ScaleReq, _Triggers}) ->
      NewAlarms =
         case get_alarm(Name, Alarms) of
              {error, unknown_alarm} ->
                  comm:send(Pid, {toggle_alarm_resp, {error, unknown_alarm}}),
                  Alarms;
              {ok, Alarm}        ->
                  Toggled = case Alarm#alarm.state of
                                active   -> Alarm#alarm{state = inactive};
                                inactive -> Alarm#alarm{state = active}
  