Improved test. Repeat the same but with atomics inside. It should be the same result