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


    @nodes = newnodes

    @animations = @animations.concat(anims)

    return


class HuffmanNodeCollection extends NodeCollection
  constructor: (shape) ->

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