preparing to BB algorithm