Fixed the code, and removed the duplicates in plk.py