Bug fix.
Changed the bwa calls, grouping the functions into something more modular.