Updated code sample.