Update impi.py

Updated based on comments