Updated bdd function according to the new solver