Uses AtomicInteger instead of simples "int"

Merge changes done on "atomic" to "master"