forming square or rectangular cells