added encoder.js