Changed formula and sort

gives 2 improved results for precision, formula can probably be tweaked
further