moved initialize function to external js file