Using AtomicInteger instead of int[]