fixed cam's code and incorporated into nodes.js from popup.js. not tested yet, but at least it doesn't break the nodes code.