implemented #91, but screwed up the JS in the process