move to Util.Pair and Util.BS