anchor.diff:      {ok, Row, NCBState} =
   	(State#state.callback):row(ProcessInfo, State#state.cbstate),
       hpi(Rest, State#state{ cbstate = NCBState }, [Row|Acc]).
  -
  -update_headers(Headers, _State) ->
  -    lists:foldl(fun(RX, LineNumber) ->
  -			cecho:mvaddstr(LineNumber,0,RX),
  -			LineNumber + 1
  -		end, 1, Headers).
   
   sort(ProcList, State) ->
       Sorted = lists:keysort(State#state.sort, ProcList),
  
positive.code: 		  _ ->
  		      string:left(StrColVal, Width)
  	      end,
      ok = cecho:mvaddstr(LineNumber, Offset, Aligned),
      update_row(Rest, RestColumns, LineNumber, Offset+Width+1).
      
      
  
negative.code: flags2str([_|Rest]) ->
      flags2str(Rest).
  
  loop(Parent, State) ->
      receive
  	time_update ->
  	    State2 = update_screen(State),
  	    erlang:send_after(State2#state.interval, self(), time_update),
  	    loop(Parent, State2);
  	force_update ->
  	    State2 = update_screen(State),
  	    loop(Parent, State2);
  	{sort, N} when is_integer(N) ->
  	    State2 = update_sort_screen(State, N),
  	    loop(Parent, State2);
  	{sort, Direction} ->
  	    case Direction of
  		next -> State2 = update_sort_screen(State, State#state.sort + 1);
  		prev -> State2 = update_sort_screen(State, State#state.sort - 1)
  	    end,
  	    loop(Parent, State2);
  	reverse_sort ->
  	    State2 = update_screen(State#state{ reverse_sort = (not State#state.reverse_sort) }),
  	    loop(Parent, State2);
  	{'EXIT', Parent, _} ->
  	    ok
      end.
  
  update_sort_screen(State, N) ->
      if N >= 1 andalso N =< length(State#state.columns) ->
  	    update_screen(State#state{ sort = N });
         true -> State
      end.
  
  update_screen(State) ->
      print_nodeinfo(State),
      draw_title_bar(State),
      {Time, {ok, SysInfo, PInfo}} = timer:tc(rpc, call, [State#state.node, State#state.remote_module, get_data, []]),
      print_showinfo(State, Time),
      {Headers, State1} = handle_system_info(SysInfo, State),
      lists:foldl(fun(Header, Y) -> cecho:mvaddstr(Y, 0, Header), Y + 1 end, 1, Headers),
      {ProcList, State2} = handle_process_info(PInfo, State1), 
      SortedProcList = sort(ProcList, State),
      {Y, _} = cecho:getmaxyx(),
      StartY = (Y-(Y-7)),
      lists:foreach(fun(N) -> cecho:move(N, 0), cecho:hline($ , ?MAX_HLINE) end, lists:seq(StartY, Y)),
      update_rows(SortedProcList, State2#state.columns, StartY, Y),
      cecho:refresh(),
      State2.
  
  draw_title_bar(State) ->
      cecho:move(6, 0),
      cecho:attron(?ceA_REVERSE),
      cecho:hline($ , ?MAX_HLINE),
      draw_title_bar(State#state.columns, 0),
      cecho:attroff(?ceA_REVERSE).
  
  draw_title_bar([], _) -> ok;
  draw_title_bar([{Title, Width, Options}|Rest], Offset) ->
      Align = proplists:get_value(align, Options, left),
      cecho:mvaddstr(6, Offset, string:Align(Title, Width)++" "),
      draw_title_bar(Rest, Offset + Width + 1).
  
  print_showinfo(State, RoundTripTime) ->
      cecho:move(5, 0),
      cecho:hline($ , ?MAX_HLINE),
      ColName = element(1,lists:nth(State#state.sort, State#state.columns)),
      SortName = if State#state.reverse_sort -> "Descending"; true -> "Ascending" end,
      Showing = io_lib:format("Showing: Interval ~p ms, Sorting on ~p (~s), Retrieved in ~p ms", 
  			    [State#state.interval, ColName, SortName, RoundTripTime div 1000]),
      cecho:mvaddstr(5,0, lists:flatten(Showing)).
  
  handle_system_info(SystemInfo, State) ->
      {ok, Headers, NCBState} = (State#state.callback):header(SystemInfo, State#state.cbstate),
  