Added logic for multiple bam files