Makes some changes to make compatible with DO and changes the input order to make more senese