take an outptr for the return value