added constructor for grid