       
       numwant = parseInt get_vars['numwant']
       numwant = 50 if isNaN(numwant) or numwant < 0 or numwant > 50
-      
+
       multi
-        .ZCARD(key + ':seeds')
-        .ZCARD(key + ':peers')
-        .ZRANGE(key + ':seeds', 0, numwant)
-        .ZRANGE(key + ':peers', 0, numwant)
+        .ZCARD(key_seed)
+        .ZCARD(key_peer)
+        .ZRANGE(key_seed, 0, numwant)
+        .ZRANGE(key_peer, 0, numwant)
         .exec (err, replies) =>
-          #res.end 'hi'
-          #return
+
           if err? then return simple_response res, {'failure reason': 'wat'}
           doCompact = get_vars['compact'] is '1'
           
           peerlist = replies[5].concat(replies[6])
             .slice(0, numwant)
             .map (p) ->
+              peer_entry = JSON.parse p
               if doCompact
-                return p.slice 20, 26
+                return peer_entry['compacted']
               else
-                return {'peer id': p.slice(0, 20), 'ip' : p.slice(26,41) , 'port' : p.slice(41,46)}
+                delete peer_entry['compacted']
+                return peer_entry
           if doCompact
-            out = new Buffer (peerlist.length*6)
-            for i in [0..peerlist.length-1]
-              peerlist[i].copy out, i*6, 0
-            peerlist = out
+            peerlist = peerlist.join ''
+            peerlist = new Buffer peerlist, 'base64'
           
           return simple_response res,
             'interval'     : ANNOUNCE_INTERVAL

# helper functions
simple_response = (res, data) ->
  res.setHeader 'Content-Type', 'text/plain'
  res.end (bencode.bencode data)

#compact = (ip, port) -> ip.split('.').concat([port >> 8 & 0xFF, port & 0xFF]).map((c) -> String.fromCharCode c)
compact = (ip, port) -> new Buffer ip.split('.').concat([port >> 8, port & 0xFF])

parse = (qs) ->
  obj = {}

      output += (str.charCodeAt i).toString 16
  return output.toLowerCase()

# Tracker class
class Tracker
  constructor: (port) ->
    # redis
    @redis = require('redis').createClient 6379, '127.0.0.1' #, {'return_buffers' : true})
    
    # mongodb
    @torrents = null
