added error checking for fork
added code headers and function documentation
added necessary documentation files