initial merge of new npdm code up to 2pdm