working version of Bscan (checked on zedboard)