added warning when gw is called with y containing negative values