Update the sample code for the latest engine.