moved javascript to main.js