major bug causing the script to load the entire bam into memory