lookup now takes into account sortedness of children