function each (arr, iterator, callback) {
  var idx = 0
  var len = arr.length
  var results = []

  function done (err, res) {
    var i = idx++

    if (err) return callback(err, results)
    if (res) results[i] = res
    if (idx < len) return iter.call(this)

    return callback(err, results)
  }

  function iter () {
    iterator(arr[idx], idx, done)
  }

  iter()
}

module.exports = each

@@ -42,18 +42,16 @@
 %0A  var i
-dx
  = 0%0A  v
@@ -127,19 +127,30 @@
     
-var i = idx
+results%5Bi%5D = res%0A    i
 ++%0A%0A
@@ -204,104 +204,74 @@
 if (
-res) results%5Bi%5D = res%0A    if (idx %3C len) return iter.call(this)%0A%0A    return callback(err, result
+i === len) return callback(err, results)%0A%0A    return iter.call(thi
 s)%0A 
@@ -317,16 +317,12 @@
 rr%5Bi
-dx
 %5D, i
-dx
 , do

refactor series-each