added an osx check for processor part, more paths and wrapped sam to bam in subroutine