removed the intermediate console.log calls