Watershed source code