tweaked statcounter code