debugged writeSBtab