Added reorder function