deleted unnecessary arrays
V array converted to vector of vectors