some js to make things pretty, plus some templating