Setting up proper FILEs for stdin/out, adding memset function