adding encapsulation.js