genZoneContChunk gridw gridh zonew zoneh x y i c x0 y0 zg types sizes rrands (k:ks) (j:js) = do
  let nzg = expandZone zonew zoneh zg
      zg0 = map (genZoneContChunkRow gridw gridh zonew zoneh x y c i (fst k) (snd k) (fst j) (snd j) types sizes rrands) nzg
      zg1 = stripGrid zg0
      zg2 = flattenGrid zg1
  genZoneContChunk gridw gridh zonew zoneh x y (i+1) c x0 y0 zg2 types sizes rrands ks js
genZoneContChunk gridw gridh zonew zoneh x y i c x0 y0 zg types sizes rrands (k:ks) (j:js) = do
  let nzg = expandZone zonew zoneh zg
      zg0 = map (genZoneContChunkRow gridw gridh zonew zoneh x y c i (fst k) (snd k) (fst j) (snd j) types sizes rrands) nzg
      zg1 = stripGrid zg0
      zg2 = flattenGrid zg1
  genZoneContChunk gridw gridh zonew zoneh x y (i+1) c x0 y0 zg2 types sizes rrands ks js
genZoneContChunk gridw gridh zonew zoneh x y i c x0 y0 zg types sizes rrands (k:ks) (j:js) = do
  let nzg = expandZone zonew zoneh zg
      zg0 = map (genZoneContChunkRow gridw gridh zonew zoneh x y c i (fst k) (snd k) (fst j) (snd j) types sizes rrands) nzg
      zg1 = stripGrid zg0
      zg2 = flattenGrid zg1
  genZoneContChunk gridw gridh zonew zoneh x y (i+1) c x0 y0 zg2 types sizes rrands ks js