fix leaf node detection
fix width, height calculation
remove rebar
don't store center in a node
flatten operation