avoid some copies

I'm still not sure why there were those NaN errors before. This disturbs me.