wrapping up javascript