update weights vector