Enhanced sample code.