switch to 2 dimensional array for grid representation
switch to 2 dimensional array for grid representation