sub searchLoop { - pass in: - target number (y) - number of elements desired (x) - the array (array) - y offset number (offset, starts at 0) - sort array in descending numerical order and store that into a temporary array that you can mess with. - remove entries in the temp array that are larger than y - foreach ( unshift a value off temp array into z) remaining entry: - if z = y, print z+offset as a solution (or return it if you only need one solution) - run searchLoop(y-z, x-1, temp (with the z element removed), offset+z) }