     }
 }
 
+import flash.text.TextFormat;
 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;
-    
+
+class Badge extends flash.display.Sprite
+{
+    /* Number of proxy pairs currently connected. */
+    private var num_proxy_pairs:int = 0;
+    /* Number of proxy pairs ever connected. */
+    private var total_proxy_pairs:int = 0;
+
     [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;
-        
+
+    public function Badge()
+    {
         /* 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 InternetFreedomBadge(this);
                badge.display();
            } else {
                output_text = new TextField();
                output_text.width = stage.stageWidth;

        private var output_text:TextField;
        
        /* Badge for display */
        private var badge:Badge;

        private var fac_addr:Object;
        private var relay_addr:Object;
