perrin's initial commit of javascript code