reformat code
fix floating leg calculation
fix reorder warning