added several functions. Updated the grid