main modified, to add console.log