Added a lot more logging