implementing darwin half of #19