switched from array to vector