fixed cdp bugs, trying to immitate dp