added method to print the grid