keep a running count instead of counting each time
whitespace
change var name
Merge branch 'max' into develop