rebuild the array