updated to include collapsing, and identified a problem with using biom for this