added sam2bam function