extend write bif to multiple arguments