Cleaned up code: removed console.log statements, and unnecessary variables and functions.