Fix a bug for computing shift
Add StringBM class