       numwant = 50 if isNaN(numwant) or numwant < 0 or numwant > 50
       
       multi
-        .ZCOUNT(key + ':seeds', 0, t)
-        .ZCOUNT(key + ':peers', 0, t)
+        .ZCARD(key + ':seeds')
+        .ZCARD(key + ':peers')
         .ZRANGE(key + ':seeds', 0, numwant)
         .ZRANGE(key + ':peers', 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_id, ip, port, compacted] = JSON.parse p
-              if doCompact then compacted else {'peer id': peer_id, ip, port}
-          peerlist = peerlist.join '' if doCompact
+              if doCompact
+                return p.slice 20, 26
+              else
+                return {'peer id': p.slice(0, 20), 'ip' : p.slice(26,41) , 'port' : p.slice(41,46)}
+          if doCompact
+            out = new Buffer (peerlist.length*6)
+            for i in [0..peerlist.length-1]
+              peerlist[i].copy out, i*6, 0
+            peerlist = out
           
           return simple_response res,
             'interval'     : ANNOUNCE_INTERVAL

    # GET requests of interest are:
    #   info_hash, peer_id, port, uploaded, downloaded, left,   <--- REQUIRED
    #   compact, no_peer_id, event, ip, numwant, key, trackerid <--- optional
    
    info_hash = decodeURIComponent get_vars['info_hash']
    peer_id = decodeURIComponent get_vars['peer_id']
    
    port = parseInt get_vars['port']
    left = parseInt get_vars['left']
    if info_hash == '' or peer_id == '' or isNaN(port) or isNaN(left)
      return simple_response res, {'failure reason': 'Invalid Request'}
    
    @torrents.findOne {info_hash}, (err, exists) =>
      if err? then return simple_response res, {'failure reason': 'wat'}
      if !exists then return simple_response res, {'failure reason': 'This torrent does not exist'}
      
      event = get_vars['event']
      if event == 'stopped' or event == 'paused'
        return simple_response res, 'Nani?'
      
      t = Date.now()
      key = 'torrent:' + info_hash
      multi = @redis.multi()
        .ZREMRANGEBYSCORE(key + ':seeds', 0, t - ANNOUNCE_INTERVAL * 6000)
        .ZREMRANGEBYSCORE(key + ':peers', 0, t - ANNOUNCE_INTERVAL * 6000)
      
      ip = get_vars['ip']
      ip = req.client.remoteAddress if !ip?
      ip = process.env['HTTP_X_REAL_IP'] if ip is '127.0.0.1'
      
      peer = JSON.stringify [peer_id, ip, port, compact(ip, port)]
      suffix = if (left == 0) then ":seeds" else ":peers"
      multi.ZADD key + suffix, t, peer
      
      if event == 'completed' #increment snatch
        @torrents.update {info_hash}, {$inc: {snatches: 1}}
      
      # Output now. Fields are:
      #   interval, complete, incomplete, peers (dict|bin) <--- REQUIRED

# 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 = {}
