got file redirection working, theres a few bugs that need to be fixed though.