Add generatorB and generatorD (#4)

Closes #4. Is there more efficient implementation?