Added sorting method for string using least significant digit.