added sb_init function and a few other tweaks