Implemented selection filtering.

Also added barcode variation calculations (and filtering).