prettied up the javascript