cleaning of prim.py