Replacing a deprecated function in the documentation and example code.