Setup signal handlers. They seem to be working to spec but will double-check. Removed unneccessary typecasting from malloc() statements. Code seems done and bug-free