add barcode sort to read database. 

Also added to the end of admin writeout database.