wrote a bitty amount of JS to answer the question.