impruving strFanction() to deal with min and max values