made dp.py; went through a lot of hoops to make it work in python 3.4