added some code fore testing file redirection, still not working though