function gidTable = buildGidTable (gidTable,max_row_idx)

idx=1;
for i=1:max_row_idx
    for k=1:max_row_idx    
        gy=i;
        gx=k;
        gid=getGid(gx,gy,max_row_idx);
        gidTable=[gidTable;idx,gid];
        idx=idx+1;
    end
end