Improved example with previous changes