reorder inputs