Wrote a first draft of bflexergen.py