added solution for vector.c