common files added and main.js basic functions