fixed defect with root counting.