MAINT: begin code to remove redundant nodes