Implemented Exec function with fork, execv, and wait