added a bunch of logging