debugged and implemented forking