Fixed #2. Use process.stdout instead of console.log