Cost calculation might work now. Derived segments are multiplied by 1.6. Needs refactoring.