changed so scatterv works