Intermediate commit. Basic Horizontal/Vertical rectangle differentiation & pair matching based on distance(crude & so far ineffective)