updated example code to be consistent with docs