remove zero degree nodes