40D port of 1000d_dev from coutts