complete rewrite, moved performance.js to index.html