Task 8 and 9 completed - signal handler function