working on barcode function