Minor Edit on my function

change makes sure only one result is returned and that result is the one
with the smallest parameters