take #1

Sorry for putting all the js in one file.