changed EqualTo to CompareTo so that it works for older root versions