initialization of grid now in a more logical way