     stopped = new Set
 
     start = (names) ->
-      console.log('starting:', names)
       starting.add names
       Promise.all names.map (name) ->
         callback = services[name].start
         promise = Promise.resolve(callback())
         promise.then ->
-          console.log('running:  ' + name)
-          starting.remove name
+          starting.delete name
           running.add name
           # start all we can start now that have not been started
-          toStart = new Set(dag.whereAllParentsIn(running.elements()))
-            .remove(starting)
-            .remove(running)
-            .elements()
+          toStart = new Set(dag.whereAllParentsIn(running.keys()))
+            .delete(starting)
+            .delete(running)
+            .keys()
           start toStart
 
     stop = (names) ->
-      console.log('stopping: ', names)
       stopping.add names
       return Promise.all names.map (name) ->
         callback = services[name].stop
         promise = Promise.resolve callback()
         promise.then ->
-          console.log('stopped:  ' + name)
-          stopping.remove name
+          stopping.delete name
           stopped.add name
           # stop all we can stop now that have not been stopped
-          toStop = new Set(dag.whereAllChildrenIn(stopped.elements()))
-            .remove(stopping)
-            .remove(stopped)
-            .elements()
+          toStop = new Set(dag.whereAllChildrenIn(stopped.keys()))
+            .delete(stopping)
+            .delete(stopped)
+            .keys()
           stop toStop
 
     start(dag.parentless())
       .then ->
-        test.ok running.isEqual new Set Object.keys(services)
-        test.ok starting.isEqual new Set
+        test.ok running.equals new Set Object.keys(services)
+        test.ok starting.equals new Set
         stop dag.childless()
       .then ->
-        test.ok stopped.isEqual new Set Object.keys(services)
-        test.ok stopping.isEqual new Set
+        test.ok stopped.equals new Set Object.keys(services)
+        test.ok stopping.equals new Set
         test.done()

module.exports =

  'systems are started and stopped in the most efficient order': (test) ->

    ###################################################################################
    # services

    services =
      redisOne:
        start: ->
          test.ok starting.equals(
            new Set('redisOne', 'redisTwo', 'postgres', 'elasticSearch', 'mailAPI')
          )
          test.ok running.equals(
            new Set
          )
          Promise.delay(10)
