added total nodes for depth 2
switching views works, code is messy
Merge branch 'refactor' into gh-pages