First part of grid setup