cleaning code in flagcatcher.js