added parent funtion and child function
Added include for string
moved code from the signal handler to the appropricate functions for first signal
moved code from signal handler to the appropriate functions for second signal