anchor.diff:  -module(zole_ws_handler).
  +-define(PROMPT_REPEAT,10000).
   -import(lists,[delete/2,nth/2,split/2,sort/2,map/2,nth/2,zip/2,member/2,reverse/1,foreach/2,all/2]).
   -import(maps,[get/2,put/3,from_list/1,to_list/1,is_key/2,keys/1,get/3,update/3]).
   
  
positive.code:     lager:info("WS handle ~p ~p ~n",[ Data, State]),
      {ok, Req, State}.
  
  websocket_info(Msg, Req, State) ->
      lager:info("WS info ~p ~n",[Msg]),
      {reply, {text, jsx:encode(transform(Msg))}, Req, State}.
  
  websocket_terminate(Reason, _Req, State) ->
          lager:info("WS TERMINATE ~p ~p~n",[Reason, State]),
  	ok.
  
  handle([<<"login">>, N], {} = S) ->
      Name = binary_to_list(N),
  
negative.code:     TableName = binary_to_list(N),
      R = table_sup:join_or_create(TableName, true),
      {Resp, NewState} = case R of
  		   {ok, Pid} -> {{ok}, {joined, Pid, false, 0, empty}};
  		   E -> {E, S}
  	       end,
      {response(Resp, join), NewState};
  handle([<<"leave">>], {joined, TablePid, _, _, _} = S) ->
      R = table_sup:leave(TablePid),
      NewState = case R of
  		   {ok} -> {logged_in};
  		   _ -> S
  	       end,
      {response(R, leave), NewState};
  handle([<<"lielais">>], {joined, TablePid, _, _, _} = S) ->
      R = table_sup:lielais(TablePid),
      {response(R, lielais), new_state(R, S)};
  handle([<<"zole">>], {joined, TablePid, _, _, _} = S) ->
      R = table_sup:zole(TablePid),
      {response(R, zole), new_state(R, S)};
  handle([<<"pass">>], {joined, TablePid, _, _, _} = S) ->
      R = table_sup:pass(TablePid),
      {response(R, pass), new_state(R, S)};
  handle([<<"last_game">>], {joined, TablePid, _, _, _} = S) ->
      R = table_sup:last_game(TablePid),
      {response(R, last_game), S};
  handle([<<"tables">>], S) ->
      spawn(?MODULE, get_tables, [self()]),
      {response({ok}, tables), S};
  handle([<<"play">>, Crd], {joined, TablePid, _, _, _} = S) ->
      Cs = (catch decode_card(Crd)),
      case Cs of
  	{'EXIT', _} ->
  