Enhance Part 3 sample code