Use polygon count directly & use absolute path for source data file
Fix path generation & small refactoring