For safety's sake we should probably add an extra clause for the last element in the list to guarantee a snippet will be shown. Something like `if (k == snippets.length - 1 || random_number < snippets[k].parentNode.dataset.weight) {`.