can you initialize jmg before the loop?