use vec(x) instead of x[:]