Added logging back in
More tweaks
Fixed properly this time