moved javascript to js file