added missing comma
refactored some variables for clarity, stats is now hasStats, and changed redundant checks for if(hasStats == true) to if(hasStats)
Merge pull request #1 from posmicanomaly/master

added missing comma, and some refactoring.