minor changes to js.
Minor code formatting.
Using fancy's tree.count().