Update to pass in pointers intead of references.