Rewrite communities and A as arrays for speed