updated smart.js