applied changes to main2.js