Added Logging, Updated for 3.8