added a bunch of logging stuff..i think