Added Stdout redirect logic and some basic file operations