first draft of selection code for DpToKpipi