watch.js implementation