added a couple things to the file redirection code but still has some bugs