Add logging at key points