anchor.diff:              NewDic      = dict:store(Variable, NewData, State#state.keystore),
               State#state{keystore = NewDic}
       end;
  +
  +%%%%------------------------------------------------------------------
  +%%%% Action: <<"read_random_array_idx">>
  +%%%%------------------------------------------------------------------
  +do_action(<<"read_random_doc_set_idx">>, undefined, _Children, State) ->
  +    State;
  +do_action(<<"read_random_doc_set_idx">>, {Args}, _Children, State) ->
  +    Key           = proplists:get_value(<<"key">>, Args),
  +    Variable      = proplists:get_value(<<"variable">>, Args),
  +
  +    {ok, {Array}} = dict:find(Key, State#state.keystore),
  +    case length(Array) of 
  +        0 ->
  +            State;
  +        Len ->
  +            Idx          = random:uniform(Len),
  +            {_, NewData} = lists:nth(Idx, Array),
  +            NewDic       = dict:store(Variable, NewData, State#state.keystore),
  +            State#state{keystore = NewDic}
  +    end;
  +
   
   %%%%------------------------------------------------------------------
   %%%% Action: <<"conditional">>
  
positive.code:     end;
  
  %%%%------------------------------------------------------------------
  %%%% Action: <<"read_random_array_idx">>
  %%%%------------------------------------------------------------------
  do_action(<<"read_random_array_idx">>, undefined, _Children, State) ->
  
negative.code:     Key         = proplists:get_value(<<"key">>, Args),
      Idx         = proplists:get_value(<<"idx">>, Args),
      Variable    = proplists:get_value(<<"variable">>, Args),
      NewIdx      = get_stored_value(Idx, State),
      {ok, Array} = dict:find( Key, State#state.keystore),
      case is_binary(NewIdx) of
  