add p nary search