moved most of barcoding statistic calculation into function
new
moved into functions