josh's initial commit, with new watershed fn