copy and set up javascript