prep new branch
Added writeBdf function