Added a redirection function, although string parsing still needs to be done