Added 2D grid data structure and UpdateGrid() method