dp with procedures