modified initialize grid