Fixed SW stress functions, lots of changesgit add .