more practical way of drawing grid.
some code spacing/cleanup.