cleaned up grid.js