Revised parapy.py

Major revision to the code. Now it works