Modified used vector<vector<bool>> instead of 2d arrays for the ability to resize the grid