upated script to not use console.log