making sam to bam into a real bash script