Merged the BWM code (not tested on injections)