restructured tree, added js-ex2