Modified and tested the semivariance function