Added lots of logging