 
     @nodes = newnodes
 
+    return anims
+
+  addAnimations: (anims) ->
     @animations = @animations.concat(anims)
-
-    return
-
 
 class HuffmanNodeCollection extends NodeCollection
   constructor: (shape) ->

    len: (x: default_node_radius*4, y: default_node_radius*2)

  copyNodesFrom: (nc) ->
    @nodes = [
      new ShannonFanoNode(nc.nodes, @shape, @defaultBBoxAt((x:100,y:100)), "") ]


    name: 'sort by weight',
    action: (c, t) ->
      console.log('sort by weight')
      c.addAnimations(c.sortNodes( ((n1, n2) -> n2.value - n1.value), t))
  },
  {
    name: 'automatic Huffman step',
