Updated StrToLong (able to detect overflow of input) and sorting
methods.