Update simpleUI.js

Started refactoring loop for adding nodes to the tree.