redid script.js so sample works