Merge pull request #2 from CloCkWeRX/upstream

Flatten updateTree() slightly, minor syntax/style changes
Merge pull request #3 from CloCkWeRX/upstream

Simplify moveTo() logic