start repairing and refactoring DP stuff