added node collapsing