Working first draft of tiling algorithm for location grid