debugged a bunch of stuff, started exposing pub functions