Added a constructor for passing in a Grid object