took out the console.log from function and added a return inside the function for the outside console.log