Clean up the js, add some of brian's suggestions