improved comple.py