changed MBIA algorithm