Updated stat counter script