refactored tokens and hopefully fixed the javascript