     for ipdic in json_data.ips
       iplst.push ipdic.ip
 
+    #remove unused ip
     db.ips.find({},{'_id': false, 'port': false}).forEach (err, docs) ->
       if err then throw err
       if docs != null
         if docs.ip not in iplst
           db.ips.remove {ip: docs.ip}
 
+    #add jobs to q
     for ip in iplst
       q.add scanOne, ip
 

      console.log '...All jobs done'
      db.close()

#    q.on 'jobStart', (args) ->
#      console.log 'jobStart', args._jobId

#    q.on 'jobEnd', (args) ->
#      console.log 'jobEnd', args._jobId

    q.run()



##scanner.coffee
fs = require 'fs'
exec = require('child_process').exec
mongojs = require 'mongojs'
http = require 'http'
qjobs = require 'qjobs'
