Sounds like we can rely on dimension data being sorted, but not on in which order.  I might just add a few lines that check for order first and then bisect accordingly.