removed javascript to separate .js file