improved demo example