change recalc, to allow girds with size!=4