split into separate funcs. so search starts at smaller integer