Preserving the array index value order