added the execv
merged my code with yours