better reorder memory usage