reorganize array