modified sample.js