attempting to fix Issue #8 regarding output redirection bug