new method of computing bm2aff. also some bug fixes