fixed Pmi.py