store nodes in a 2D array for better grid distance perf