added (a lot) more logging