David's first version. Only change is to add a comment in the ruby script