Better csv to vector function