Update grid.js

updated code to reflect inc variable