moving js to seperate file