Add David M Gay's implementation