Full example with new logging