sorts array with integer values