handle wrap-around cases when matching...
