add code for simpler bam decoding