Modified logging. I need andrews changes.