the script now accepts .bam files (not just .sam) as input