total km and rearrange form inputs