Changed the return type from console.log to true/false.