At the moment, the algorithm for determine which element is above or below the current element relies on an exact match between their x coordinates. This would break if there is any kind of spatial offset between elements (eg. one is slightly offset to the left or right of the other). Also, we currently determine horizontal positioning based on document order, but it's quite conceivable that CSS may be used to position items next to each other that are not siblings within the DOM.
So, we need to fix the code to use ranges of x and y coordinates to determine the spatial position of all elements. This should be done in a way that is independent from re-ordering, such that anyone can use our cool new spatial calculator.