added vec_write.c