         cur_client_count_tf.x=47;
         cur_client_count_tf.y=6;
 
+        addChild(new BadgeImage());
+        addChild(tot_client_count_tf);
+        addChild(cur_client_count_tf);
+
         /* Update the client counter on badge. */
         update_client_count();
     }
-    
-    public function display():void
-    {
-        ui.addChild(new BadgeImage());
-        /* Tried unsuccessfully to add counter to badge. */
-        /* For now, need two addChilds :( */
-        ui.addChild(tot_client_count_tf);
-        ui.addChild(cur_client_count_tf);
-    }
-    
-    public function get num_proxy_pairs():uint
-    {
-        return _num_proxy_pairs;
-    }
-    
-    public function set num_proxy_pairs(amount:uint):void
-    {
-        _num_proxy_pairs = amount;
+
+    public function proxy_begin():void
+    {
+        num_proxy_pairs++;
+        total_proxy_pairs++;
         update_client_count();
     }
-    
-    public function get total_proxy_pairs():uint
-    {
-        return _total_proxy_pairs;
-    }
-    
-    public function set total_proxy_pairs(amount:uint):void
-    {
-        _total_proxy_pairs = amount;
-        /* note: doesn't update, so be sure to update this
-           before you update num_proxy_pairs! */
-    }
-    
+
+    public function proxy_end():void
+    {
+        num_proxy_pairs--;
+        update_client_count();
+    }
+
     private function update_client_count():void
     {
         /* Update total client count. */

    }
}

import flash.text.TextField;
import flash.text.TextFormat;

class InternetFreedomBadge {
    
    private var ui:swfcat;
    
    private var _num_proxy_pairs:uint;
    private var _total_proxy_pairs:uint;
    
    [Embed(source="badge.png")]
    private var BadgeImage:Class;
    private var tot_client_count_tf:TextField;
    private var tot_client_count_fmt:TextFormat;
    private var cur_client_count_tf:TextField;
    private var cur_client_count_fmt:TextFormat;
    
    public function InternetFreedomBadge(ui:swfcat)
    {
        this.ui = ui;
        _num_proxy_pairs = 0;
        _total_proxy_pairs = 0;
        
        /* Setup client counter for badge. */
        tot_client_count_fmt = new TextFormat();
        tot_client_count_fmt.color = 0xFFFFFF;

            debug_mode = (this.loaderInfo.parameters["debug"] != null)
            proxy_mode = (this.loaderInfo.parameters["proxy"] != null);
            if (proxy_mode && !debug_mode) {
                badge = new Badge();
                addChild(badge);
            } else {
                output_text = new TextField();
                output_text.width = stage.stageWidth;
