Added separate function to sort SSN