replaced all process.stdout with console.log