some changes from modelica by KW
some changes from modelica by KW