bwa wrapper rewritten