reduce the "expanding" hbox/vbox mode to two passes, simplify much of the logic