First draft of function in open.c and namev.c