 
   moveDown: (idx) ->
     store = @_store
-    # this subtly relies on x <= undefined being false for all x to
-    # do the right thing at leaf nodes
     lci = @leftChildIdx(idx)
     rci = @rightChildIdx(idx)
-    if store[rci]? and ! @_comparator(store[lci], store[rci]) #store[lci = @leftChildIdx(idx)] <= store[rci = @rightChildIdx(idx)]
+    if store[rci]? and ! @_comparator(store[lci], store[rci])
       child    = store[rci]
       childIdx = rci
     else
       child    = store[lci]
       childIdx = lci
-    if child? and ! @_comparator(val = store[idx], child) #(val = store[idx]) <= child
+    if child? and ! @_comparator(val = store[idx], child)
       store[idx]      = child
       store[childIdx] = val
       console.dir [idx, val, childIdx, child]

  rightChildIdx: (idx) ->
    2 * idx + 1

module.exports = PriorityQueue

  moveUp: (idx) ->
    store = @_store
    if @_comparator(val = store[idx], store[par = @parentIdx(idx)])
      store[idx] = store[par]
      store[par] = val
      @moveUp(par)
