More formally, the data being sorted can be represented as a record or tuple of values, and the part of the data that is used for sorting is called the "key". In the card example, cards are represented as a record (rank, suit), and the key is the rank. A sorting algorithm is stable if whenever there are two records R and S with the same key, and R appears before S in the original list, then R will always appear before S in the sorted list.