Updated using of CompareTo and Equals