Added compare function of terms eight for uasort