major changes to js - implemented module pattern for organization