array is sorting and displaying for top