Resolve order of inputs then outputs and place arguement names in header where needed