Sort array of fractions