added leave function for w(sea) and w(cave)