add routines to drop redundant terminal nodes. #2