Added a version of the standard ws with internal gradient computation