builds a grid