public int CompareTo (object obj) { KeyBlock kb = (KeyBlock) obj; int nLength = Length; int nLengthOther = kb.Length; if (nLengthOther == nLength) return (int) (kb.first - first); return nLength - nLengthOther; } }