added constructor that initializes the grid