Updated example code to match demo