imroveBsf function implemented