Swap function order