implemented AtomicIntger to pass int as a reference