changed alerts to console.log