I know what you're doing here. But I think you might want to add parentheses to make this more readable.

return &(*agent);