added main.js code

added main.js code