adding barcode generator function to barcode object