using sigaction() instead of signal(); minor cleanups