Preparing for MHIPS and BP algorithms in ps.py