added the console.log to display final result