removed unnecessary console.log within the log() function.