Modified the code in psh.py