Implemented dp learning