fix stupid bug again =__= in stuff_db.py
change count value to int
add calc_pmi.py
fix bugs and try to accelerate