added printGrid() and util files