Implementation of BMA