polishing function.py