Revisions to functions to use pointers to pointers