correct order of array elements