fixed up the grid and cleaned up the index