removed signalnames
removed extra openlog and closelog
added spaces for readability