better ST0 generation

* preamble
* bug fix
* remove FB variable