added some comments. Code is more consistent. Everywhere except the UI. node is a model node. a ui node can be called by get ui ref.