orderData_cpp function

Reorder data