changed the console.log statements to returns