write bb file