Fixing function in example code.