manually merging gridNode code from @jpumpelly