Added a bunch of logging