added program output redirection