pmf.py and psgd.py added and tested.