adding for loop for printing grid out