Updated SWAT code