More work on js/results.js [to be merged with previous commit]