on second thought, building the list in javascript is cool but not the most straightforward way to do this