updated for version 7.4.358
Problem:    Sort is not always stable.
Solution:   Add an index instead of relying on the pointer to remain the same.
	    Idea by Jun Takimoto.
Added tag v7-4-358 for changeset 771b97ba3b47