polishing loppdetector logic