Increased grid size so code can be cleaner.

Used larger grid size (N+1 by N+1) so i = 1 will refer to first row, etc.