update bmap algorithm