finish convert sort array