Jenny has provided a working method. Just needs to be coded in more
general way.