Just like the previous sketches, but now the tree is an object and only has to do computations on an event call.

Instructions