the grid code we made in class