Added matchMargins function, to facilitate safe matching of bin pairs to bins.