convert foo to store result into a pointer instead of returning it