added  N_M and N_B as atomics