rewritten watershed.

although doesn't work yet, but doesn't crash as well! (it even makes images)