Updated sample.js