Changed vector to do v->val[] calls