         min: parseFloat line[3]
         volume: parseFloat line[5]
         amount: parseFloat line[6]
-    callback null, ret
+    ret
 
-exports.io = io = (inputFile, outputFile) ->
-  fs.readFile inputFile, encoding: 'ascii', (err, data) ->
-    throw err if err
-    f data, (err, data) ->
-      throw err if err
-      fs.writeFile outputFile, JSON.stringify(data), encoding: 'ascii', (err) ->
-        throw err if err
+exports.sync = sync = (inputFile, outputFile) ->
+  Q.nfcall fs.readFile, inputFile, encoding: 'ascii'
+  .then f
+  .then (data) ->
+    Q.nfcall fs.writeFile, outputFile, JSON.stringify(data), encoding: 'ascii'
 
 if require.main == module
   do ->

csvParse = require 'csv-parse'
fs = require 'fs'
_ = require 'lodash'

exports.f = f = (input, callback) ->
  csvParse input, (err, data) ->
    callback err if err
    filtered = _.filter data, (i) ->
      1 < i.length
    ret = {}

      help: 'output file'
      required: true
    args = parser.parseArgs()
    sync args.input, args.output
    .done()
