shift the code write before and prepare to re-implement b_i.hat
implement b.hat.y