updated structure of sample.js and minor presentation change to main.html