deal with lead nodes
got the terminals in there. ugly, but works
Merge pull request #1 from ludflu/deal-with-leaf-nodes

Deal with leaf nodes