removed handling of SIGHUP and SIGTSTP; code cleanup