Update how grid is rendered

This is where grid will be rendered, so here there is more patches to fix the height problem.