bM2a function

Helper functions