bdd bead coded. TODO: print beads
a lot of work trying to count the number of bdd instruction