some changes on impi.py and cms.py