carried stuff over to index.html from charge.js