functions for wse-clipping