Added more functionality to fork()