added basic IO redirection