sorting all available codes according to the date on which they are added
added function to remove the exising available codes from idnex