array-sorting issues