need to add function range from smallest to biggest