anchor.diff:    end.
   
   doGetUser(Ukey) ->
  -  case qredis:q(["GET", lists:concat(["datasmart:users:", Ukey, ":profile"])]) of
  +  case qredis:q(["HGETALL", lists:concat(["datasmart:users:", Ukey, ":profile"])]) of
       {ok, Result} ->
  -      {Json} = jiffy:decode(Result),
  +      Json = ds_util:list_to_keyval(Result),
  +      User = [{binary_to_atom(Key, utf8), Val} || {Key, Val} <- Json],
  +      {ok, User};
  +    _ -> {error, "No User was Found"}
  +  end.
  +
  +doUpdateProfile(Ukey, KeyValList) ->
  +  case qredis:q(["HEXISTS", lists:concat(["datasmart:users:", Ukey, ":profile"]), "email"]) of
  +    {ok, 1} ->
  +      [qredis:q(["HSET", lists:concat(["datasmart:users:", Ukey, ":profile"]), Key, Val]) ||
  +        {Key, Val} <- KeyValList],
  +      {ok, List} = qredis:q(["HGETALL", lists:concat(["datasmart:users:", Ukey, ":profile"])]),
  +      Json = ds_util:list_to_keyval(List),
         User = [{binary_to_atom(Key, utf8), Val} || {Key, Val} <- Json],
         {ok, User};
       _ -> {error, "No User was Found"}
     end.
   
   hashPass(Password, Salt, 0) ->
  -  hash_md5:build( lists:concat([Password, Salt]) );
  +  hash_md5:build(lists:concat([Password, Salt]));
   
   hashPass(Password, Salt, Factor) when (Factor rem 2) > 0 ->
  -  hashPass(hash_md5:build( lists:concat([Password, Salt]) ), Salt, Factor - 1 );
  +  hashPass(hash_md5:build(lists:concat([Password, Salt])), Salt, Factor - 1);
   
   hashPass(Password, Salt, Factor) ->
  -  hashPass(hash_md5:build( lists:concat([Salt, Password]) ), Salt, Factor - 1 ).+  hashPass(hash_md5:build(lists:concat([Salt, Password])), Salt, Factor - 1).
positive.code: 
  getuser(Ukey) -> gen_server:call(?MODULE, {getuser, Ukey}).
  
  encrypt(Ukey, IVec, Text) ->
    {ok, Secret} = qredis:q(["GET", lists:concat(["datasmart:users:", Ukey, ":secret"])]),
    {ok, crypto:des_cbc_encrypt(Secret, IVec, Text)}.
  
negative.code: 
  handle_call({getuser, Ukey}, _From, State) ->
    {reply, doGetUser(Ukey), State};
  
  handle_call({updateprofile, Ukey, KeyValList}, _From, State) ->
    {reply, doUpdateProfile(Ukey, KeyValList), State};
  
  handle_call({checkuser, Email, Password}, _From, State) ->
    {reply, doCheckuser(Email, Password), State}.
  